﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ERF.Menu
{
    public class MenuValueItem : MenuItem
    {
        private Object itemValue;
        private Menu menu;

        public Object Value
        {
            get { return itemValue; }
            set { itemValue = value; }
        }

        public MenuValueItem(String title, Object itemValue, Menu menu)
            : base(title)
        {
            this.itemValue = itemValue;
            this.menu = menu;
            this.action = this.select;
        }

        private void select()
        {
            this.menu.Back();
        }

        public MenuValueItem(String title, Object itemValue, MenuAction action)
            : base(title, action)
        {
            this.itemValue = itemValue;
        }
    }
}
